import { http } from '@/utils/http'
import type { components } from '@/types/ApiInterface'

// 获取所有门禁设备
export const getAllGateDevicesAPI = (params: { communityId: string }) => {
  return http.get<components['schemas']['GateDeviceFindAllResponse'][]>('/api/gateDevice/all', 
    params,
  )
}

// 创建门禁权限
export const createGatePermissionAPI = (data: components['schemas']['GatePermissionCreateDto']) => {
  return http.post<components['schemas']['GatePermissionCreateResponse']>(
    '/api/gatePermission/create',
    data,
  )
}

// 删除门禁权限
export const deleteGatePermissionAPI = (
  data: components['schemas']['GatePermissionIdExistDto'],
) => {
  return http.post<components['schemas']['GatePermissionDeleteResponse']>(
    '/api/gatePermission/delete',
    data,
  )
}
